<template>
  <el-container>
    <el-header style="height: 80px;">
      <el-row>
        <el-col :span="24">
          <img src="@/assets/logo.png" width="140px" style="padding-top:10px; padding-left:20px;" />
        </el-col>
      </el-row>
    </el-header>
    <el-main>
      <div class="login_window">
        <h2>登录</h2>
        <el-form status-icon label-width="100px" class="demo-ruleForm">
          <el-form-item label="用户名">
            <el-input type="text" auto-complete="no"></el-input>
          </el-form-item>
          <el-form-item label="密码">
            <el-input type="password" auto-complete="no"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" style="float: right;width: 250px;" @click='login'>登录</el-button>
          </el-form-item>
        </el-form>
        <el-button type="text" style="float: right;" @click="sbTip">forget password?</el-button>
      </div>
    </el-main>
    <el-footer>&copy; 2020</el-footer>
  </el-container>
</template>

<script>
export default {
  data () {
    return {}
  },
  computed: {
    userInfo () {
      return this.$store.state.userInfo
    },
    isLogin () {
      return this.$store.state.isLogin
    }
  },
  methods: {
    login () {
      this.$router.push({ name: 'app' })
    },
    sbTip () {
      this.$confirm('忘了就忘了吧, 反正没有找回功能, 是否继续?', '哈哈 666', {
        confirmButtonText: '去找管理员',
        cancelButtonText: '残忍拒绝',
        type: 'warning',
        center: true
      })
        .then(() => {
          this.$message({
            type: 'success',
            message: '去吧，亚古兽!'
          })
        })
        .catch(() => {
          this.$message({
            type: 'info',
            message: '去吧，皮卡丘'
          })
        })
    }
  }
}
</script>

<style>
.login_window {
  width: 350px;
  height: 300px;
  background: white;
  padding: 30px;
  float: right;
  margin-right: 60px;
  margin-top: 80px;
}

.el-form-item__label {
  width: 80px !important;
}

.el-container {
  height: 100%;
}

.el-header {
  height: 80px;
  background-color: white;
  line-height: 80px;
}

.el-header > span,
.el-header .el-dropdown {
  font-size: 18px;
}

.el-footer {
  background-color: #252d36;
  color: #ffc852;
  text-align: center;
  line-height: 60px;
}

.el-main {
  color: #333;
  text-align: center;
}
</style>
